package dao

import (
	"user-h2/inits"
	"user-h2/models"
)

func GetUser(phone string) (result *models.User, err error) {
	inits.DB.Debug().Where("phone = ?", phone).Limit(1).Find(&result)
	return
}

func Create(user *models.User) error {
	return inits.DB.Debug().Create(&user).Error
}
